#pragma once

#include <string>
#include <vector>

class Util
{
    public:
    static std::string IntToStr(int val)
    {
        return std::to_string(val);
    } 
    static int StrToInt(const std::string& str)
    {
        return std::stoi(str);
    }
    static void StringSplit(const std::string&str,const std::string&sep,std::vector<std::string>*result)
    {
        size_t left = 0;
        size_t right = 0;
        while(right<str.size())
        {
            right = str.find(sep,left);
            if(right == std::string::npos)
            {
                break;
            }
            result->push_back(str.substr(left,right-left));
            left = right+sep.size();
        }
        if(left<str.size())
        {
            result->push_back(str.substr(left));
        }
    }
};